package com.bdqn;

import com.bdqn.pojo.TestEntity;
import com.bdqn.pojo.User;
import com.bdqn.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test {
    @Test
    public void test1(){
        ApplicationContext ctx=new ClassPathXmlApplicationContext("applicationContext.xml");
//        TestEntity testEntity= (TestEntity) ctx.getBean("entity");

        UserService service= (UserService) ctx.getBean("userService");
        User user=new User();
        user.setId(1);
        user.setUsername("test");
        user.setPassword("123456");
        user.setEmail("test@xxx.com");
        service.save(user);

    }
}
